package com.multi.thread.chapter03.demo18;

/**
 *	ThreadLocal不同线程拥有不同的值
 */
public class Test {
	
	private static ThreadLocal<String> tl = new ThreadLocal<>();
	
	public static void main(String[] args) {
		if (tl.get() == null) {
			System.out.println("ThreadLocal从未存放过值!");
			tl.set("test");
		}
		System.out.println(tl.get());
		System.out.println(tl.get());
	}

}
